{template 'common/header'}

{php load()->func('tpl')}

 <div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
        	<input type="hidden" name="m" value="hl_dqq" />
        	<input type="hidden" name="do" value="awardlist" />
        	<input type="hidden" name="id" value="{$_GPC['id']}" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">登记情况</label>
				<div class="col-sm-8 col-lg-9 col-xs-12 ">
					<select name="isregister" class="form-control">
						<option value=""  {if $_GPC['isregister'] == ''}  selected {/if}>全部</option>
						<option value="1" {if $_GPC['isregister'] == '1'} selected {/if}>已登记</option>
						<option value="2" {if $_GPC['isregister'] == '2'} selected {/if}>未登记</option>
					</select>
				</div>
			</div>
            <div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">中奖情况</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					<select name="isaward" class="form-control">
						<option value=""  {if $_GPC['isaward'] == ''}selected{/if}>全部</option>
						<option value="1" {if $_GPC['isaward'] == 1} selected{/if}>已中奖</option>
						<option value="2" {if $_GPC['isaward'] == 2} selected{/if}>未中奖</option>
					</select>
				</div>
			</div>
            <div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">个人信息</label>
				<div class=" col-md-2 col-xs-12">
					<select name="profile"  class="form-control">
						<option value="" selected="selected">请选择搜索用户资料</option>
						<option {if $_GPC['profile'] == 'realname'}selected{/if} value="realname">姓名</option>
						<option {if $_GPC['profile'] == 'mobile'}selected{/if} value="mobile">手机</option>
						<option {if $_GPC['profile'] == 'qq'}selected{/if} value="qq">QQ</option>
					</select>
				</div>
                <div class=" col-md-2 col-xs-12">
					<input type="text" name="profilevalue" value="{$_GPC['profilevalue']}"  class="form-control" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">中奖时间</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					 {php echo tpl_form_field_daterange('daterange',array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d',$endtime)))}
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">奖品信息</label>
			    <div class=" col-md-2 col-xs-12">
					<select name="award" class="form-control" style="float:left;">
						<option value="" selected="selected">请选择搜索奖品资料</option>
						<option {if $_GPC['award'] == 'title'}selected{/if} value="title">名称</option>
						<option {if $_GPC['award'] == 'description'}selected{/if} value="description">描述</option>
					</select>
				</div>
				<div class=" col-md-2 col-xs-12">
					<input type="text" name="awardvalue" value="{$_GPC['awardvalue']}" class='form-control' style="float:left;"/>
               	</div>
                <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                <button name="export" class="btn btn-default" value="export"><i class="fa fa-download"></i> 导出数据</button>
			</div>
		</form>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-heading">详细数据</div>
        <div class="panel-body table-responsive">
			<form action="" method="post" onsubmit="">
				<table class="table table-hover">
					<thead class="navbar-inner">
					<tr>
						<th style="max-width:5%;" class="row-first">选择</th>
						<th style="max-width:10%;" class="row-hover">姓名</th>
						<th style="max-width:10%;">手机</th>
						<th style="max-width:10%;">QQ</th>
						<th style="max-width:10%;">奖品</th>
						<th style="max-width:15%;">描述</th>
						<th style="max-width:10%;">获取时间</th>
						<th style="max-width:20%;">操作</th>
					</tr>
					</thead>
					<tbody>
					{loop $list $row}
					<tr>
						<td class="row-first"><input type="checkbox" name="select[]" value="{$row['id']}" /></td>
						<td class="row-hover">{$row['realname']}</td>
						<td>{$row['mobile']}</td>
						<td>{$row['qq']}</td>
						<td>{$row['award']}</td>
						<td>{$row['description']}</td>
						<td style="font-size:12px; color:#666;">
							{php echo date('Y-m-d H:i:s', $row[createtime]);}
						</td>
						<td>
							{if empty($row['award'])}
								<a href="javascript:;" class="btn btn-warning">未中奖</a>
							{else}
								{if $row['status'] == 0 || $row['status'] == 1}
									<a href="{php echo $this->createWebUrl('awardlist', array('id' => $id, 'wid' => $row['id'], 'status' => 2))}" class="btn btn-success">确认领奖</a>
								{else}
									<a href="{php echo $this->createWebUrl('awardlist', array('id' => $id, 'wid' => $row['id'], 'status' => 0))}" class="btn btn-danger">取消领奖</a>
								{/if}
							{/if}
						</td>
					</tr>
					{/loop}
					</tbody>
				</table>
				<table class="table">
					<tr>
						<td style="width:40px;" class="row-first">
							<input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck})" />
						</td>
						<td>
							<input type="submit" name="delete" value="删除" class="btn btn-primary" />
							<input type="hidden" name="token" value="{$_W['token']}" />
						</td>
					</tr>
				</table>
			</form>
			{$pager}
		</div>
</div>

<script type="text/javascript">
	require(['daterangepicker'], function($){
		$('.daterange').on('apply.daterangepicker', function(ev, picker) {
			$('#form1')[0].submit();
		});
	});
</script>

{template 'common/footer'}
